package hk.edu.hk.app;


import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class HelloWorldApp extends Activity {
    /** Called when the activity is first created. */
    @Override
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hello_world);
        View view = new View(this);
        view.setBackgroundColor(222);
        Button button = (Button)findViewById(R.id.Button01);
        
        button.setOnClickListener(new OnClickListener(){
			public void onClick(View arg0) {
				openDialog();
			}
        });
    }
    
    private void openDialog(){
    	String[] arg0 = {"football", "basketball", "pingpang","badminton", "tennis ball", "pingpang"};
    	AlertDialog.Builder builder = new AlertDialog.Builder(this);
    	builder.setSingleChoiceItems(arg0,1,null);
		builder.setTitle("Choose your favorite:");
		//builder.setMessage("Hello World \n");
		builder.setNegativeButton("OK",null);

		builder.show();
    } 
}